class TFMedPack extends TFPowerups;

state Activated
{
	function BeginState()
	{
		local float amount, tmp;

        initialstate='activated';
        if(instigator==none) instigator=pawn(owner);
        Owner.PlaySound(ActivateSound,SLOT_Interface,3);

        amount=fmax(0,fmin(40,100-instigator.health));
        if(amount<40) tmp=fmax(0,fmin((40-amount)/2,199-instigator.health));

        instigator.Health+=amount+tmp;

        Destroy();
	}

    function Timer()
    {
    }

	function EndState()
	{
        bActive = false;
	}

	function Activate()
	{
	}
}

defaultproperties
{
     bAutoActivate=True
     bActivatable=True
     ActivateSound=Sound'PickupSounds.HealthPack'
     bReplicateInstigator=True
     SkillCost=10
}
